package mx.netbrain.model;

// Generated Sep 26, 2012 10:26:19 PM by Hibernate Tools 3.4.0.CR1

import java.math.BigDecimal;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.UniqueConstraint;

/**
 * Storage generated by hbm2java
 */
@Entity
@Table(name = "storage", catalog = "netbrain", uniqueConstraints = {
		@UniqueConstraint(columnNames = "name"),
		@UniqueConstraint(columnNames = "route") })
public class Storage implements java.io.Serializable {

	private Integer id;
	private Status status;
	private String name;
	private String route;
	private BigDecimal space;
	private Boolean share;
	private Date register;

	public Storage() {
	}

	public Storage(Status status, String name, String route, BigDecimal space,
			Date register) {
		this.status = status;
		this.name = name;
		this.route = route;
		this.space = space;
		this.register = register;
	}

	public Storage(Status status, String name, String route, BigDecimal space,
			Boolean share, Date register) {
		this.status = status;
		this.name = name;
		this.route = route;
		this.space = space;
		this.share = share;
		this.register = register;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "status", nullable = false)
	public Status getStatus() {
		return this.status;
	}

	public void setStatus(Status status) {
		this.status = status;
	}

	@Column(name = "name", unique = true, nullable = false, length = 50)
	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	@Column(name = "route", unique = true, nullable = false, length = 100)
	public String getRoute() {
		return this.route;
	}

	public void setRoute(String route) {
		this.route = route;
	}

	@Column(name = "space", nullable = false, precision = 9)
	public BigDecimal getSpace() {
		return this.space;
	}

	public void setSpace(BigDecimal space) {
		this.space = space;
	}

	@Column(name = "share")
	public Boolean getShare() {
		return this.share;
	}

	public void setShare(Boolean share) {
		this.share = share;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "register", nullable = false, length = 19)
	public Date getRegister() {
		return this.register;
	}

	public void setRegister(Date register) {
		this.register = register;
	}

}
